package com.wondream.java.io.example.file;

import java.io.FileReader;
import java.io.IOException;

public class FileReaderTest {
    final static String fileName = "./tmp/info.log";

    public static void main(String[] args) throws IOException {

        FileReader reader = new FileReader(fileName);
        StringBuilder result = new StringBuilder();
        char[] buffer = new char[2];
        int dataLen = -1;
        while((dataLen = reader.read(buffer)) != -1){
            result.append(buffer, 0, dataLen);
        }
        System.out.println("[[FileReaderTest.main]] result: "+result);
        reader.close();
    }
}
